-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ESC-340] Fix Underline on text block #598
Conversation
WalkthroughThe changes in this pull request involve updating the configuration for HTMLPurifier in the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
api/config/purify.php (2)
43-43
: Approve change and suggest minor improvementThe addition of the 'u' tag to the 'HTML.Allowed' configuration successfully addresses the issue of underline formatting not being saved in text blocks. This change aligns perfectly with the PR objectives and should resolve the problem described in issue #593.
For improved clarity and maintainability, consider adding a comment explaining the purpose of including the 'u' tag. This will help future developers understand the reasoning behind this specific configuration. Here's a suggested implementation:
- 'HTML.Allowed' => 'h1,h2,b,u,strong,i,em,a[href|title],ul,ol,li,p,br,span,*[style]', + 'HTML.Allowed' => 'h1,h2,b,u,strong,i,em,a[href|title],ul,ol,li,p,br,span,*[style]', // 'u' tag included to allow underline formatting
Line range hint
102-106
: Consider removing commented-out codeTo improve code cleanliness and reduce potential confusion for future developers, consider removing the commented-out serializer configuration at the end of the file. If this alternative configuration is important to keep for reference, it might be better to document it elsewhere, such as in a README or configuration guide.
Here's the suggested change:
- // 'serializer' => [ - // 'disk' => env('FILESYSTEM_DISK', 'local'), - // 'path' => 'purify', - // 'cache' => \Stevebauman\Purify\Cache\FilesystemDefinitionCache::class, - // ],If you decide to keep this commented code, please add a comment explaining why it's being kept and under what circumstances it might be used.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- api/config/purify.php (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
api/config/purify.php (2)
Line range hint
1-108
: Summary and Next StepsThis change effectively addresses the issue of underline formatting not being saved in text blocks by adding the 'u' tag to the HTMLPurifier configuration. The modification is minimal and focused, which is positive.
To ensure the change is fully validated and integrated:
- Implement the suggested verification steps to check for any security implications or unintended effects.
- Update or add relevant tests to cover the new behavior.
- Perform thorough manual testing across the application.
- Consider the suggested code cleanliness improvements.
Once these steps are completed and no issues are found, this change should be ready for merging.
43-43
: Verify security implications and test thoroughlyWhile the addition of the 'u' tag is a minimal change that addresses the specific issue, it's important to ensure it doesn't introduce any security vulnerabilities or unintended side effects.
Please run the following verification steps:
Security check:
Usage verification:
Test coverage:
After running these checks, please ensure to:
- Review any security-related findings and assess their relevance to this change.
- Update any custom HTML purification logic if necessary.
- Add or update tests to cover the new behavior, especially focusing on the preservation of underline formatting.
- Perform thorough manual testing to verify that underline formatting is correctly saved and displayed across different parts of the application.
Fixed #593
Summary by CodeRabbit
New Features
<u>
HTML tag, allowing text to be underlined in user-generated content.Bug Fixes